import java.util.Arrays;

public class Test {
    public static void sort(int[] arr) {
        int left = 0;


        int right= arr.length-1;
        while(left<right){
            while(arr[left] % 2 != 0){
                left++;
            }
            while( arr[right] % 2 == 0){
                right--;
            }
            if (left < right) {
                int tmp =arr[left];
                arr[left]=arr[right];
                arr[right]=tmp;

            }
        }

    }
    public static void main(String[] args) {
        int[] arr = new int[]{1,6,3,9,55,6};
        sort(arr);
        System.out.println(Arrays.toString(arr));


    }

}
